|
In the analysis of algorithms, the master theorem provides a solution in asymptotic terms (using Big O notation) for recurrence relations of types that occur in the analysis of many divide and conquer algorithms. It was popularized by the canonical algorithms textbook ''Introduction to Algorithms'' by Cormen, Leiserson, Rivest, and Stein, in which it is both introduced and proved. Not all recurrence relations can be solved with the use of the master theorem; its generalizations include the Akra–Bazzi method. == Introduction == Consider a problem that can be solved using a recursive algorithm such as the following: procedure T( n : size of problem ) defined as: if n < 1 then exit Do work of amount f(n) T(n/b) T(n/b) ...repeat for a total of ''′a′'' times... T(n/b) end procedure In the above algorithm we are dividing the problem into a number of subproblems recursively, each subproblem being of size ''n/b''. This can be visualized as building a call tree with each node of the tree as an instance of one recursive call and its child nodes being instances of subsequent calls. In the above example, each node would have ''a'' number of child nodes. Each node does an amount of work that corresponds to the size of the sub problem ''n'' passed to that instance of the recursive call and given by . The total amount of work done by the entire tree is the sum of the work performed by all the nodes in the tree. Algorithms such as above can be represented as a recurrence relation . This recursive relation can be successively substituted into itself and expanded to obtain expression for total amount of work done.〔 Duke University, "Big-Oh for Recursive Functions: Recurrence Relations", http://www.cs.duke.edu/~ola/ap/recurrence.html 〕 The Master theorem allows us to easily calculate the running time of such a recursive algorithm in Θ-notation without doing an expansion of the recursive relation above. 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Master theorem」の詳細全文を読む スポンサード リンク
|